<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html>
<head>
{include file='header.tpl' JS=$smarty.const.BAOGG_JS CSS=$smarty.const.BAOGG_CSS}      
<style type="text/css">
	tr.survey h3 {
		 background-color: #F8F8FF;
		 text-align:center;
		 vertical-align:middle;
		 display:block;
		 /*height:50px;*/
		 font-size:30px;
                padding:18px 0;
	}
	tr.group {
		 background-color: #F8F8FF;
		 text-align:center;
                 font-size:14px;
	}
        tr.group h3{
                padding:10px;
        }
	tr.row0 {
	   background-color: #EEF6FF;
	}
	tr.row1 {
	   background-color: #EBF2FA;
	}
	tr{
	   background-color:#D2E0F2;
	   width:100%;
	   border:0px solid #D2E0F2;
	   text-align:right;
	}
	tr.row-seperator{
                border:1px solid #D2E0F2;
                height:2px;       
	}
	th{
	   text-align:center;
           font-weight:bold;
           font-size:12px;
height:30px;
	}
	td select{
	   width:150px;
	   overflow:auto;
        }	
        td.col7,td.col9,td.col10 {
                text-align:center;
                min-width:60px;
        }
        td.col5{
                min-width:100px;
        }
        
        td.col8{
                width:20px;
        }
        td.parent-question{
         font-weight: bold;
          text-align:left;
          padding-left:20px;
        }
</style>
        <script type="text/javascript"> 

        var LANG={$LANG};
	function selectQuestionByGroup(group_id){
		Ext.Array.each( Ext.query("input[name*="+group_id+"]"),function(name,index,self){ name.checked=Ext.get('group_'+group_id).dom.checked; });
		Ext.Array.each( Ext.query("input[value*="+group_id+"]"),function(name,index,self){ name.checked=Ext.get('group_'+group_id).dom.checked; })	
	}
	Ext.onReady(function(){
Ext.create('Ext.container.Viewport', {
    layout: 'border',
    renderTo: Ext.getBody(),
    items: [
	
Ext.create('Ext.panel.Panel', {  
    region:'center',
    contentEl: 'form',
    autoScroll:true,
    bodyBorder:true,
    dockedItems:[{
        xtype: 'toolbar',
    	dock: 'top',
	items: [
        	{ xtype: 'button',
        		
				iconCls:'next-icon',
        		text: LANG.save,handler:function(){
			Ext.Ajax.request({
				form:'form_field',
				success:function(response,opts){
                                         var result = Ext.decode(response.responseText);
                                         top.Ext.ux.ShowResult( result);
                                         if(result.success){
                                                // top.Ext.MessageBox.hide();
					        window.location.href="{$next_url}";
                                        }
				        //console.info('success');
					//console.info(response.responseText);
				},
				failure:function(response,opts){
					//console.info('fail');
					//console.info(response);
				}
			});	
		} }
    	]   
    }]
})
]
})		
        $("input[name^=field_title]").focus(function(){
                        //console.info(this.name.split(/[\[\]]/)[1]);
                        $('input[type=checkbox][name="summary[]"][value='+this.name.split(/[\[\]]/)[1]+']')[0].checked=true
                        });
 $("input[name^=field_is_filter]").change(function(){
                        //console.info(this.name.split(/[\[\]]/)[1]);
                        $('input[type=checkbox][name="summary[]"][value='+this.name.split(/[\[\]]/)[1]+']')[0].checked=true
                        });

  $("input[name^=field_is_list]").change(function(){
                        //console.info(this.name.split(/[\[\]]/)[1]);
                        $('input[type=checkbox][name="summary[]"][value='+this.name.split(/[\[\]]/)[1]+']')[0].checked=true
                        });

   $("input[name^=field_is_chart]").change(function(){
                        //console.info(this.name.split(/[\[\]]/)[1]);
                        $('input[type=checkbox][name="summary[]"][value='+this.name.split(/[\[\]]/)[1]+']')[0].checked=true
                        });

    $("input[name^=field_is_sort]").change(function(){
                        //console.info(this.name.split(/[\[\]]/)[1]);
                        $('input[type=checkbox][name="summary[]"][value='+this.name.split(/[\[\]]/)[1]+']')[0].checked=true
                        });
 
     

	});
	</script>


</head>
<body>
  
       
<div id="form">


	<form id="form_field" method="post" action="{$smarty.server.PHP_SELF}">
		{$output}
	</form>
</div>



</body>
</html>
